<!DOCTYPE html>
<html lang="zh-Hans" dir="ltr">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>安装 | VitePress基础框架</title>
    <meta name="description" content="VitePress基础框架的站点描述">
    <meta name="generator" content="VitePress v1.3.4">
    <link rel="preload stylesheet" href="/vitepress-template-public/assets/style.BlgVYu-Y.css" as="style">
    <script type="module" src="/vitepress-template-public/assets/chunks/metadata.e7f3cd1f.js"></script>
    <script type="module" src="/vitepress-template-public/assets/app.B7Bvz4Bc.js"></script>
    <link rel="preload" href="/vitepress-template-public/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
    <link rel="modulepreload" href="/vitepress-template-public/assets/chunks/theme.B1DMWA2k.js">
    <link rel="modulepreload" href="/vitepress-template-public/assets/chunks/framework.D5O-cTmz.js">
    <link rel="modulepreload" href="/vitepress-template-public/assets/guide_install.md.BcX7LxS3.lean.js">
    <link rel="icon" type="image/svg+xml" href="./logo/vitepress-logo-mini.svg">
    <link rel="icon" type="image/png" href="./logo/vitepress-logo-mini.png">
    <script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
    <script id="check-mac-os">document.documentElement.classList.toggle("mac",/Mac|iPhone|iPod|iPad/i.test(navigator.platform));</script>
  </head>
  <body>
    <div id="app"><div class="Layout" data-v-b928bd87><!--[--><!--]--><!--[--><span tabindex="-1" data-v-7de6d21b></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-7de6d21b> Skip to content </a><!--]--><!----><header class="VPNav" data-v-b928bd87 data-v-7614e298><div class="VPNavBar" data-v-7614e298 data-v-4a78392f><div class="wrapper" data-v-4a78392f><div class="container" data-v-4a78392f><div class="title" data-v-4a78392f><div class="VPNavBarTitle has-sidebar" data-v-4a78392f data-v-a1bbf3b8><a class="title" href="/vitepress-template-public/" data-v-a1bbf3b8><!--[--><!--]--><!--[--><img class="VPImage logo" src="/vitepress-template-public/logo/vitepress-logo-mini.svg" width="24" height="24" alt data-v-5f4c361e><!--]--><span data-v-a1bbf3b8>VitePress基础框架</span><!--[--><!--]--></a></div></div><div class="content" data-v-4a78392f><div class="content-body" data-v-4a78392f><!--[--><!--]--><div class="VPNavBarSearch search" data-v-4a78392f><!----></div><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-4a78392f data-v-1eb62029><span id="main-nav-aria-label" class="visually-hidden" data-v-1eb62029> Main Navigation </span><!--[--><!--[--><a class="VPLink link VPNavBarMenuLink active" href="/vitepress-template-public/guide/install" tabindex="0" data-v-1eb62029 data-v-c4db28c0><!--[--><span data-v-c4db28c0>教程</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/vitepress-template-public/examples/markdown" tabindex="0" data-v-1eb62029 data-v-c4db28c0><!--[--><span data-v-c4db28c0>示例</span><!--]--></a><!--]--><!--[--><div class="VPFlyout VPNavBarMenuGroup" data-v-1eb62029 data-v-8c3a7de4><button type="button" class="button" aria-haspopup="true" aria-expanded="false" data-v-8c3a7de4><span class="text" data-v-8c3a7de4><!----><span data-v-8c3a7de4>下拉导航</span><span class="vpi-chevron-down text-icon" data-v-8c3a7de4></span></span></button><div class="menu" data-v-8c3a7de4><div class="VPMenu" data-v-8c3a7de4 data-v-387194d2><div class="items" data-v-387194d2><!--[--><!--[--><div class="VPMenuGroup" data-v-387194d2 data-v-91ebaee2><p class="title" data-v-91ebaee2>下拉导航标题</p><!--[--><!--[--><div class="VPMenuLink" data-v-91ebaee2 data-v-f484e6ee><a class="VPLink link vp-external-link-icon" href="https://github.com/dcdy/vitepress-template/edit/main/docs/.vitepress/config.mts" target="_blank" rel="noreferrer" data-v-f484e6ee><!--[-->子项A<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-91ebaee2 data-v-f484e6ee><a class="VPLink link vp-external-link-icon" href="https://gitee.com/xia_mei_ting/vitepress-template/blob/main/docs/.vitepress/config.mts" target="_blank" rel="noreferrer" data-v-f484e6ee><!--[-->子项B<!--]--></a></div><!--]--><!--]--></div><!--]--><!--]--></div><!--[--><!--]--></div></div></div><!--]--><!--]--></nav><!----><div class="VPNavBarAppearance appearance" data-v-4a78392f data-v-429aef54><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title aria-checked="false" data-v-429aef54 data-v-51f78c2c data-v-7bf662e2><span class="check" data-v-7bf662e2><span class="icon" data-v-7bf662e2><!--[--><span class="vpi-sun sun" data-v-51f78c2c></span><span class="vpi-moon moon" data-v-51f78c2c></span><!--]--></span></span></button></div><div class="VPSocialLinks VPNavBarSocialLinks social-links" data-v-4a78392f data-v-efa425a3 data-v-c2882db4><!--[--><a class="VPSocialLink no-icon" href="https://github.com/dcdy/vitepress-template" aria-label="github" target="_blank" rel="noopener" data-v-c2882db4 data-v-788a0e61><span class="vpi-social-github" /></a><a class="VPSocialLink no-icon" href="https://gitee.com/xia_mei_ting/vitepress-template" aria-label target="_blank" rel="noopener" data-v-c2882db4 data-v-788a0e61><svg t="1727428813465" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2268" width="200" height="200"><path d="M512 1024C229.222 1024 0 794.778 0 512S229.222 0 512 0s512 229.222 512 512-229.222 512-512 512z m259.149-568.883h-290.74a25.293 25.293 0 0 0-25.292 25.293l-0.026 63.206c0 13.952 11.315 25.293 25.267 25.293h177.024c13.978 0 25.293 11.315 25.293 25.267v12.646a75.853 75.853 0 0 1-75.853 75.853h-240.23a25.293 25.293 0 0 1-25.267-25.293V417.203a75.853 75.853 0 0 1 75.827-75.853h353.946a25.293 25.293 0 0 0 25.267-25.292l0.077-63.207a25.293 25.293 0 0 0-25.268-25.293H417.152a189.62 189.62 0 0 0-189.62 189.645V771.15c0 13.977 11.316 25.293 25.294 25.293h372.94a170.65 170.65 0 0 0 170.65-170.65V480.384a25.293 25.293 0 0 0-25.293-25.267z" fill="#C71D23" p-id="2269"></path></svg></a><!--]--></div><div class="VPFlyout VPNavBarExtra extra" data-v-4a78392f data-v-12aa81bd data-v-8c3a7de4><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-8c3a7de4><span class="vpi-more-horizontal icon" data-v-8c3a7de4></span></button><div class="menu" data-v-8c3a7de4><div class="VPMenu" data-v-8c3a7de4 data-v-387194d2><!----><!--[--><!--[--><!----><div class="group" data-v-12aa81bd><div class="item appearance" data-v-12aa81bd><p class="label" data-v-12aa81bd>主题</p><div class="appearance-action" data-v-12aa81bd><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title aria-checked="false" data-v-12aa81bd data-v-51f78c2c data-v-7bf662e2><span class="check" data-v-7bf662e2><span class="icon" data-v-7bf662e2><!--[--><span class="vpi-sun sun" data-v-51f78c2c></span><span class="vpi-moon moon" data-v-51f78c2c></span><!--]--></span></span></button></div></div></div><div class="group" data-v-12aa81bd><div class="item social-links" data-v-12aa81bd><div class="VPSocialLinks social-links-list" data-v-12aa81bd data-v-c2882db4><!--[--><a class="VPSocialLink no-icon" href="https://github.com/dcdy/vitepress-template" aria-label="github" target="_blank" rel="noopener" data-v-c2882db4 data-v-788a0e61><span class="vpi-social-github" /></a><a class="VPSocialLink no-icon" href="https://gitee.com/xia_mei_ting/vitepress-template" aria-label target="_blank" rel="noopener" data-v-c2882db4 data-v-788a0e61><svg t="1727428813465" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2268" width="200" height="200"><path d="M512 1024C229.222 1024 0 794.778 0 512S229.222 0 512 0s512 229.222 512 512-229.222 512-512 512z m259.149-568.883h-290.74a25.293 25.293 0 0 0-25.292 25.293l-0.026 63.206c0 13.952 11.315 25.293 25.267 25.293h177.024c13.978 0 25.293 11.315 25.293 25.267v12.646a75.853 75.853 0 0 1-75.853 75.853h-240.23a25.293 25.293 0 0 1-25.267-25.293V417.203a75.853 75.853 0 0 1 75.827-75.853h353.946a25.293 25.293 0 0 0 25.267-25.292l0.077-63.207a25.293 25.293 0 0 0-25.268-25.293H417.152a189.62 189.62 0 0 0-189.62 189.645V771.15c0 13.977 11.316 25.293 25.294 25.293h372.94a170.65 170.65 0 0 0 170.65-170.65V480.384a25.293 25.293 0 0 0-25.293-25.267z" fill="#C71D23" p-id="2269"></path></svg></a><!--]--></div></div></div><!--]--><!--]--></div></div></div><!--[--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-4a78392f data-v-8aa5fe9b><span class="container" data-v-8aa5fe9b><span class="top" data-v-8aa5fe9b></span><span class="middle" data-v-8aa5fe9b></span><span class="bottom" data-v-8aa5fe9b></span></span></button></div></div></div></div><div class="divider" data-v-4a78392f><div class="divider-line" data-v-4a78392f></div></div></div><!----></header><div class="VPLocalNav has-sidebar empty" data-v-b928bd87 data-v-84e6a0db><div class="container" data-v-84e6a0db><button class="menu" aria-expanded="false" aria-controls="VPSidebarNav" data-v-84e6a0db><span class="vpi-align-left menu-icon" data-v-84e6a0db></span><span class="menu-text" data-v-84e6a0db>菜单</span></button><div class="VPLocalNavOutlineDropdown" style="--vp-vh:0px;" data-v-84e6a0db data-v-39065feb><button data-v-39065feb>回到顶部</button><!----></div></div></div><aside class="VPSidebar" data-v-b928bd87 data-v-754706ac><div class="curtain" data-v-754706ac></div><nav class="nav" id="VPSidebarNav" aria-labelledby="sidebar-aria-label" tabindex="-1" data-v-754706ac><span class="visually-hidden" id="sidebar-aria-label" data-v-754706ac> Sidebar Navigation </span><!--[--><!--]--><!--[--><div class="no-transition group" data-v-a51db1f1><section class="VPSidebarItem level-0 collapsible has-active" data-v-a51db1f1 data-v-39a5995e><div class="item" role="button" tabindex="0" data-v-39a5995e><div class="indicator" data-v-39a5995e></div><h2 class="text" data-v-39a5995e>简介</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-39a5995e><span class="vpi-chevron-right caret-icon" data-v-39a5995e></span></div></div><div class="items" data-v-39a5995e><!--[--><div class="VPSidebarItem level-1 is-link" data-v-39a5995e data-v-39a5995e><div class="item" data-v-39a5995e><div class="indicator" data-v-39a5995e></div><a class="VPLink link link" href="/vitepress-template-public/guide/install" data-v-39a5995e><!--[--><p class="text" data-v-39a5995e>安装</p><!--]--></a><!----></div><!----></div><section class="VPSidebarItem level-1" data-v-39a5995e data-v-39a5995e><div class="item" role="button" tabindex="0" data-v-39a5995e><div class="indicator" data-v-39a5995e></div><h3 class="text" data-v-39a5995e>配置</h3><!----></div><div class="items" data-v-39a5995e><!--[--><div class="VPSidebarItem level-2 is-link" data-v-39a5995e data-v-39a5995e><div class="item" data-v-39a5995e><div class="indicator" data-v-39a5995e></div><a class="VPLink link link" href="/vitepress-template-public/guide/config-home" data-v-39a5995e><!--[--><p class="text" data-v-39a5995e>首页配置</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-39a5995e data-v-39a5995e><div class="item" data-v-39a5995e><div class="indicator" data-v-39a5995e></div><a class="VPLink link link" href="/vitepress-template-public/guide/config-doc" data-v-39a5995e><!--[--><p class="text" data-v-39a5995e>文档配置</p><!--]--></a><!----></div><!----></div><!--]--></div></section><!--]--></div></section></div><div class="no-transition group" data-v-a51db1f1><section class="VPSidebarItem level-0 collapsible" data-v-a51db1f1 data-v-39a5995e><div class="item" role="button" tabindex="0" data-v-39a5995e><div class="indicator" data-v-39a5995e></div><h2 class="text" data-v-39a5995e>部署</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-39a5995e><span class="vpi-chevron-right caret-icon" data-v-39a5995e></span></div></div><div class="items" data-v-39a5995e><!--[--><div class="VPSidebarItem level-1 is-link" data-v-39a5995e data-v-39a5995e><div class="item" data-v-39a5995e><div class="indicator" data-v-39a5995e></div><a class="VPLink link link" href="/vitepress-template-public/guide/github-pages" data-v-39a5995e><!--[--><p class="text" data-v-39a5995e>Github Pages</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><!--]--><!--[--><!--]--></nav></aside><div class="VPContent has-sidebar" id="VPContent" data-v-b928bd87 data-v-5d97ccec><div class="VPDoc has-sidebar has-aside" data-v-5d97ccec data-v-184b3be7><!--[--><!--]--><div class="container" data-v-184b3be7><div class="aside" data-v-184b3be7><div class="aside-curtain" data-v-184b3be7></div><div class="aside-container" data-v-184b3be7><div class="aside-content" data-v-184b3be7><div class="VPDocAside" data-v-184b3be7 data-v-f6e4fd1a><!--[--><!--]--><!--[--><!--]--><nav aria-labelledby="doc-outline-aria-label" class="VPDocAsideOutline" data-v-f6e4fd1a data-v-c582f5e1><div class="content" data-v-c582f5e1><div class="outline-marker" data-v-c582f5e1></div><div aria-level="2" class="outline-title" id="doc-outline-aria-label" role="heading" data-v-c582f5e1>页面导航</div><ul class="VPDocOutlineItem root" data-v-c582f5e1 data-v-9dd79648><!--[--><!--]--></ul></div></nav><!--[--><!--]--><div class="spacer" data-v-f6e4fd1a></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-184b3be7><div class="content-container" data-v-184b3be7><!--[--><!--]--><main class="main" data-v-184b3be7><div style="position:relative;" class="vp-doc _vitepress-template-public_guide_install external-link-icon-enabled" data-v-184b3be7><div><h1 id="安装" tabindex="-1">安装 <a class="header-anchor" href="#安装" aria-label="Permalink to &quot;安装&quot;">​</a></h1><h2 id="项目目录" tabindex="-1">项目目录 <a class="header-anchor" href="#项目目录" aria-label="Permalink to &quot;项目目录&quot;">​</a></h2><div class="language- line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang"></span><pre class="shiki one-dark-pro vp-code" tabindex="0"><code><span class="line"><span>vitepress-template</span></span>
<span class="line"><span>├─ 📁docs</span></span>
<span class="line"><span>│  ├─ 📁.vitepress</span></span>
<span class="line"><span>│  │  └─ 📄config.mts</span></span>
<span class="line"><span>│  ├─ 📄api-examples.md</span></span>
<span class="line"><span>│  ├─ 📄index.md</span></span>
<span class="line"><span>│  └─ 📄markdown-examples.md</span></span>
<span class="line"><span>├─ 📄.gitignore</span></span>
<span class="line"><span>├─ 📄package.json</span></span>
<span class="line"><span>├─ 📄pnpm-lock.yaml</span></span>
<span class="line"><span>└─ 📄README.md</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br></div></div><h2 id="安装-vitepress" tabindex="-1">安装 vitepress <a class="header-anchor" href="#安装-vitepress" aria-label="Permalink to &quot;安装 vitepress&quot;">​</a></h2><p>官网链接：<a href="https://vitejs.cn/vitepress/guide/getting-started" target="_blank" rel="noreferrer">https://vitejs.cn/vitepress/guide/getting-started</a></p><div class="vp-code-group"><div class="tabs"><input type="radio" name="group-cp7OV" id="tab-ohn6INW" checked><label for="tab-ohn6INW">npm</label><input type="radio" name="group-cp7OV" id="tab-LrObEN7"><label for="tab-LrObEN7">pnpm</label><input type="radio" name="group-cp7OV" id="tab-sLbYdHE"><label for="tab-sLbYdHE">yarn</label><input type="radio" name="group-cp7OV" id="tab-IpIvb_6"><label for="tab-IpIvb_6">yarn (pnp)</label><input type="radio" name="group-cp7OV" id="tab-VW89F81"><label for="tab-VW89F81">bun</label></div><div class="blocks"><div class="language-sh active line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">sh</span><pre class="shiki one-dark-pro vp-code" tabindex="0"><code><span class="line"><span style="color:#61AFEF;">$</span><span style="color:#98C379;"> npm</span><span style="color:#98C379;"> add</span><span style="color:#D19A66;"> -D</span><span style="color:#98C379;"> vitepress</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="language-sh line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">sh</span><pre class="shiki one-dark-pro vp-code" tabindex="0"><code><span class="line"><span style="color:#61AFEF;">$</span><span style="color:#98C379;"> pnpm</span><span style="color:#98C379;"> add</span><span style="color:#D19A66;"> -D</span><span style="color:#98C379;"> vitepress</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="language-sh line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">sh</span><pre class="shiki one-dark-pro vp-code" tabindex="0"><code><span class="line"><span style="color:#61AFEF;">$</span><span style="color:#98C379;"> yarn</span><span style="color:#98C379;"> add</span><span style="color:#D19A66;"> -D</span><span style="color:#98C379;"> vitepress</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="language-sh line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">sh</span><pre class="shiki one-dark-pro vp-code" tabindex="0"><code><span class="line"><span style="color:#61AFEF;">$</span><span style="color:#98C379;"> yarn</span><span style="color:#98C379;"> add</span><span style="color:#D19A66;"> -D</span><span style="color:#98C379;"> vitepress</span><span style="color:#98C379;"> vue</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="language-sh line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">sh</span><pre class="shiki one-dark-pro vp-code" tabindex="0"><code><span class="line"><span style="color:#61AFEF;">$</span><span style="color:#98C379;"> bun</span><span style="color:#98C379;"> add</span><span style="color:#D19A66;"> -D</span><span style="color:#98C379;"> vitepress</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div></div></div><h2 id="安装向导" tabindex="-1">安装向导 <a class="header-anchor" href="#安装向导" aria-label="Permalink to &quot;安装向导&quot;">​</a></h2><p>VitePress 附带一个命令行设置向导，可以帮助你构建一个基本项目。安装后，通过运行以下命令启动向导（全部默认就行）：</p><div class="vp-code-group"><div class="tabs"><input type="radio" name="group-LZYyX" id="tab-Oov4Y-k" checked><label for="tab-Oov4Y-k">npm</label><input type="radio" name="group-LZYyX" id="tab-ObJfMo3"><label for="tab-ObJfMo3">pnpm</label><input type="radio" name="group-LZYyX" id="tab-2crirsY"><label for="tab-2crirsY">yarn</label><input type="radio" name="group-LZYyX" id="tab-VuxJtEM"><label for="tab-VuxJtEM">bun</label></div><div class="blocks"><div class="language-sh active line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">sh</span><pre class="shiki one-dark-pro vp-code" tabindex="0"><code><span class="line"><span style="color:#61AFEF;">$</span><span style="color:#98C379;"> npx</span><span style="color:#98C379;"> vitepress</span><span style="color:#98C379;"> init</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="language-sh line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">sh</span><pre class="shiki one-dark-pro vp-code" tabindex="0"><code><span class="line"><span style="color:#61AFEF;">$</span><span style="color:#98C379;"> pnpm</span><span style="color:#98C379;"> vitepress</span><span style="color:#98C379;"> init</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="language-sh line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">sh</span><pre class="shiki one-dark-pro vp-code" tabindex="0"><code><span class="line"><span style="color:#61AFEF;">$</span><span style="color:#98C379;"> yarn</span><span style="color:#98C379;"> vitepress</span><span style="color:#98C379;"> init</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="language-sh line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">sh</span><pre class="shiki one-dark-pro vp-code" tabindex="0"><code><span class="line"><span style="color:#61AFEF;">$</span><span style="color:#98C379;"> bun</span><span style="color:#98C379;"> vitepress</span><span style="color:#98C379;"> init</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div></div></div><p>将需要回答几个简单的问题：</p><div class="language- line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang"></span><pre class="shiki one-dark-pro vp-code" tabindex="0"><code><span class="line"><span>┌  Welcome to VitePress!</span></span>
<span class="line"><span>│</span></span>
<span class="line"><span>◇  Where should VitePress initialize the config?</span></span>
<span class="line"><span>│  ./docs</span></span>
<span class="line"><span>│</span></span>
<span class="line"><span>◇  Site title:</span></span>
<span class="line"><span>│  My Awesome Project</span></span>
<span class="line"><span>│</span></span>
<span class="line"><span>◇  Site description:</span></span>
<span class="line"><span>│  A VitePress Site</span></span>
<span class="line"><span>│</span></span>
<span class="line"><span>◆  Theme:</span></span>
<span class="line"><span>│  ● Default Theme (Out of the box, good-looking docs)</span></span>
<span class="line"><span>│  ○ Default Theme + Customization</span></span>
<span class="line"><span>│  ○ Custom Theme</span></span>
<span class="line"><span>└</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br></div></div><h2 id="主要配置" tabindex="-1">主要配置 <a class="header-anchor" href="#主要配置" aria-label="Permalink to &quot;主要配置&quot;">​</a></h2><p><code>docs/.vitepress/config.mts</code>是 VitePress 配置文件，它包含了 VitePress 的所有配置项。</p><details class="details custom-block"><summary>点击查看 config.mts 完整配置</summary><div class="code-label"><div class="code-label-text">config.mts</div></div><div class="language-ts line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">ts</span><pre class="shiki one-dark-pro vp-code" tabindex="0"><code><span class="line"><span style="color:#C678DD;">import</span><span style="color:#E06C75;"> markdownItMark</span><span style="color:#C678DD;"> from</span><span style="color:#98C379;"> &#39;markdown-it-mark&#39;</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#C678DD;">import</span><span style="color:#E06C75;"> markdownItTask</span><span style="color:#C678DD;"> from</span><span style="color:#98C379;"> &#39;markdown-it-task-checkbox&#39;</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#C678DD;">export</span><span style="color:#C678DD;"> default</span><span style="color:#61AFEF;"> defineConfig</span><span style="color:#ABB2BF;">({</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">	// 应用级配置选项</span></span>
<span class="line"><span style="color:#E06C75;">	base</span><span style="color:#ABB2BF;">: </span><span style="color:#E5C07B;">ENV</span><span style="color:#ABB2BF;">.</span><span style="color:#E06C75;">VITE_BASE_URL</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 动态配置项目名</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">	// base: &#39;/vitepress-template/&#39;, // 不需要动态就写死。vitepress-template是项目名</span></span>
<span class="line"><span style="color:#E06C75;">	title</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;VitePress基础框架&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 标题</span></span>
<span class="line"><span style="color:#E06C75;">	description</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;VitePress基础框架的站点描述&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">	lang</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;zh-Hans&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 站点的 lang 属性</span></span>
<span class="line"><span style="color:#E06C75;">	appearance</span><span style="color:#ABB2BF;">: </span><span style="color:#D19A66;">true</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 外观切换 - 深色浅色</span></span>
<span class="line"><span style="color:#E06C75;">	lastUpdated</span><span style="color:#ABB2BF;">: </span><span style="color:#D19A66;">true</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 显示页面最后更新时间</span></span>
<span class="line"><span style="color:#E06C75;">	cleanUrls</span><span style="color:#ABB2BF;">: </span><span style="color:#D19A66;">true</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 删除路径中的.html后缀</span></span>
<span class="line"><span style="color:#E06C75;">	metaChunk</span><span style="color:#ABB2BF;">: </span><span style="color:#D19A66;">true</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 生成 meta 标签</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">	// markdown 解析配置</span></span>
<span class="line"><span style="color:#E06C75;">	markdown</span><span style="color:#ABB2BF;">: {</span></span>
<span class="line"><span style="color:#E06C75;">		theme</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;one-dark-pro&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 主体配色</span></span>
<span class="line"><span style="color:#E06C75;">		math</span><span style="color:#ABB2BF;">: </span><span style="color:#D19A66;">true</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 支持数学公式</span></span>
<span class="line"><span style="color:#E06C75;">		lineNumbers</span><span style="color:#ABB2BF;">: </span><span style="color:#D19A66;">true</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 显示行号</span></span>
<span class="line"><span style="color:#E06C75;">		codeCopyButtonTitle</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;复制代码&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">		container</span><span style="color:#ABB2BF;">: {</span></span>
<span class="line"><span style="color:#E06C75;">			tipLabel</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;提示&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">			warningLabel</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;警告&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">			dangerLabel</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;危险&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">			infoLabel</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;信息&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">			detailsLabel</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;详细信息&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#ABB2BF;">		},</span></span>
<span class="line"><span style="color:#E06C75;">		image</span><span style="color:#ABB2BF;">: {</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">			// 默认禁用图片懒加载</span></span>
<span class="line"><span style="color:#E06C75;">			lazyLoading</span><span style="color:#ABB2BF;">: </span><span style="color:#D19A66;">true</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#ABB2BF;">		},</span></span>
<span class="line"><span style="color:#61AFEF;">		config</span><span style="color:#ABB2BF;">: </span><span style="color:#E06C75;font-style:italic;">md</span><span style="color:#C678DD;"> =&gt;</span><span style="color:#ABB2BF;"> {</span></span>
<span class="line"><span style="color:#E5C07B;">			md</span><span style="color:#ABB2BF;">.</span><span style="color:#61AFEF;">use</span><span style="color:#ABB2BF;">(</span><span style="color:#E06C75;">markdownItMark</span><span style="color:#ABB2BF;">);</span></span>
<span class="line"><span style="color:#E5C07B;">			md</span><span style="color:#ABB2BF;">.</span><span style="color:#61AFEF;">use</span><span style="color:#ABB2BF;">(</span><span style="color:#E06C75;">markdownItTask</span><span style="color:#ABB2BF;">, {</span></span>
<span class="line"><span style="color:#E06C75;">				disabled</span><span style="color:#ABB2BF;">: </span><span style="color:#D19A66;">true</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 是否禁用</span></span>
<span class="line"><span style="color:#E06C75;">				divWrap</span><span style="color:#ABB2BF;">: </span><span style="color:#D19A66;">true</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 是否在 div 中包裹</span></span>
<span class="line"><span style="color:#E06C75;">				divClass</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;custom-checkbox&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// div包装器的类名。仅在启用divWrap时使用</span></span>
<span class="line"><span style="color:#E06C75;">				idPrefix</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;cbx_&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 复选框输入的ID包含前缀和从0开始的递增数字</span></span>
<span class="line"><span style="color:#E06C75;">				ulClass</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;task-list-ul&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// ul wrapper的classname</span></span>
<span class="line"><span style="color:#E06C75;">				liClass</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;task-list-li&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// li wrapper的classname</span></span>
<span class="line"><span style="color:#ABB2BF;">			});</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">			// 为图片添加 img-wrapper 类</span></span>
<span class="line"><span style="color:#E5C07B;">			md</span><span style="color:#ABB2BF;">.</span><span style="color:#E5C07B;">renderer</span><span style="color:#ABB2BF;">.</span><span style="color:#E5C07B;">rules</span><span style="color:#ABB2BF;">.</span><span style="color:#61AFEF;">image</span><span style="color:#56B6C2;"> =</span><span style="color:#ABB2BF;"> (</span><span style="color:#E06C75;font-style:italic;">tokens</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;font-style:italic;">idx</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;font-style:italic;">options</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;font-style:italic;">env</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;font-style:italic;">self</span><span style="color:#ABB2BF;">) </span><span style="color:#C678DD;">=&gt;</span><span style="color:#ABB2BF;"> {</span></span>
<span class="line"><span style="color:#C678DD;">				const</span><span style="color:#E5C07B;"> token</span><span style="color:#56B6C2;"> =</span><span style="color:#E06C75;"> tokens</span><span style="color:#ABB2BF;">[</span><span style="color:#E06C75;">idx</span><span style="color:#ABB2BF;">];</span></span>
<span class="line"><span style="color:#C678DD;">				const</span><span style="color:#E5C07B;"> src</span><span style="color:#56B6C2;"> =</span><span style="color:#E5C07B;"> token</span><span style="color:#ABB2BF;">.</span><span style="color:#61AFEF;">attrGet</span><span style="color:#ABB2BF;">(</span><span style="color:#98C379;">&#39;src&#39;</span><span style="color:#ABB2BF;">);</span></span>
<span class="line"><span style="color:#C678DD;">				const</span><span style="color:#E5C07B;"> alt</span><span style="color:#56B6C2;"> =</span><span style="color:#E5C07B;"> token</span><span style="color:#ABB2BF;">.</span><span style="color:#E06C75;">content</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">				// 返回自定义的 HTML 结构，给图片加上 onerror 事件</span></span>
<span class="line"><span style="color:#C678DD;">				return</span><span style="color:#98C379;"> `</span></span>
<span class="line"><span style="color:#98C379;">                    &lt;span class=&quot;img-wrapper&quot;&gt;</span></span>
<span class="line"><span style="color:#98C379;">                        &lt;img </span></span>
<span class="line"><span style="color:#98C379;">                            src=&quot;</span><span style="color:#C678DD;">${</span><span style="color:#E06C75;">src</span><span style="color:#C678DD;">}</span><span style="color:#98C379;">&quot; </span></span>
<span class="line"><span style="color:#98C379;">                            alt=&quot;</span><span style="color:#C678DD;">${</span><span style="color:#E06C75;">alt</span><span style="color:#C678DD;">}</span><span style="color:#98C379;">&quot; </span></span>
<span class="line"><span style="color:#98C379;">                            class=&quot;img-loading&quot; </span></span>
<span class="line"><span style="color:#98C379;">                            onload=&quot;this.classList.remove(&#39;img-loading&#39;)&quot; </span></span>
<span class="line"><span style="color:#98C379;">                            onerror=&quot;this.classList.remove(&#39;img-loading&#39;); this.classList.add(&#39;img-error&#39;)&quot; </span></span>
<span class="line"><span style="color:#98C379;">                        /&gt;</span></span>
<span class="line"><span style="color:#98C379;">                    &lt;/span&gt;</span></span>
<span class="line"><span style="color:#98C379;">                `</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">			};</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">			// 修改GitHub 风格的警报默认标题为中文</span></span>
<span class="line"><span style="color:#E5C07B;">			md</span><span style="color:#ABB2BF;">.</span><span style="color:#E5C07B;">renderer</span><span style="color:#ABB2BF;">.</span><span style="color:#E5C07B;">rules</span><span style="color:#ABB2BF;">.</span><span style="color:#61AFEF;">github_alert_open</span><span style="color:#56B6C2;"> =</span><span style="color:#C678DD;"> function</span><span style="color:#ABB2BF;"> (</span><span style="color:#E06C75;font-style:italic;">tokens</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;font-style:italic;">idx</span><span style="color:#ABB2BF;">) {</span></span>
<span class="line"><span style="color:#C678DD;">				const</span><span style="color:#ABB2BF;"> { </span><span style="color:#E5C07B;">title</span><span style="color:#ABB2BF;">, </span><span style="color:#E5C07B;">type</span><span style="color:#ABB2BF;"> } </span><span style="color:#56B6C2;">=</span><span style="color:#E06C75;"> tokens</span><span style="color:#ABB2BF;">[</span><span style="color:#E06C75;">idx</span><span style="color:#ABB2BF;">].</span><span style="color:#E06C75;">meta</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">				// let typeArr = [&#39;TIP&#39;, &#39;WARNING&#39;, &#39;DANGER&#39;, &#39;INFO&#39;, &#39;NOTE&#39;,&#39;IMPORTANT&#39;,&#39;CAUTION&#39;];</span></span>
<span class="line"><span style="color:#C678DD;">				let</span><span style="color:#E06C75;"> typeArr</span><span style="color:#56B6C2;"> =</span><span style="color:#ABB2BF;"> [</span></span>
<span class="line"><span style="color:#ABB2BF;">					{ </span><span style="color:#E06C75;">type</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;TIP&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;建议&#39;</span><span style="color:#ABB2BF;"> },</span></span>
<span class="line"><span style="color:#ABB2BF;">					{ </span><span style="color:#E06C75;">type</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;NOTE&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;提醒&#39;</span><span style="color:#ABB2BF;"> },</span></span>
<span class="line"><span style="color:#ABB2BF;">					{ </span><span style="color:#E06C75;">type</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;INFO&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;信息&#39;</span><span style="color:#ABB2BF;"> },</span></span>
<span class="line"><span style="color:#ABB2BF;">					{ </span><span style="color:#E06C75;">type</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;IMPORTANT&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;重点&#39;</span><span style="color:#ABB2BF;"> },</span></span>
<span class="line"><span style="color:#ABB2BF;">					{ </span><span style="color:#E06C75;">type</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;WARNING&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;警告&#39;</span><span style="color:#ABB2BF;"> },</span></span>
<span class="line"><span style="color:#ABB2BF;">					{ </span><span style="color:#E06C75;">type</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;CAUTION&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;注意&#39;</span><span style="color:#ABB2BF;"> },</span></span>
<span class="line"><span style="color:#ABB2BF;">					{ </span><span style="color:#E06C75;">type</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;DANGER&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;危险&#39;</span><span style="color:#ABB2BF;"> },</span></span>
<span class="line"><span style="color:#ABB2BF;">				];</span></span>
<span class="line"><span style="color:#C678DD;">				const</span><span style="color:#E5C07B;"> attrs</span><span style="color:#56B6C2;"> =</span><span style="color:#98C379;"> &#39;&#39;</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#C678DD;">				return</span><span style="color:#98C379;"> `&lt;div class=&quot;</span><span style="color:#C678DD;">${</span><span style="color:#E06C75;">type</span><span style="color:#C678DD;">}</span><span style="color:#98C379;"> custom-block github-alert&quot;</span><span style="color:#C678DD;">${</span><span style="color:#E06C75;">attrs</span><span style="color:#C678DD;">}</span><span style="color:#98C379;">&gt;&lt;p class=&quot;custom-block-title&quot;&gt;</span><span style="color:#C678DD;">${</span></span>
<span class="line"><span style="color:#E5C07B;">					typeArr</span><span style="color:#ABB2BF;">.</span><span style="color:#61AFEF;">find</span><span style="color:#ABB2BF;">(</span><span style="color:#E06C75;font-style:italic;">e</span><span style="color:#C678DD;"> =&gt;</span><span style="color:#E5C07B;"> e</span><span style="color:#ABB2BF;">.</span><span style="color:#E06C75;">type</span><span style="color:#56B6C2;"> ===</span><span style="color:#E06C75;"> title</span><span style="color:#ABB2BF;">)?.</span><span style="color:#E06C75;">text</span><span style="color:#56B6C2;"> ||</span><span style="color:#E06C75;"> title</span></span>
<span class="line"><span style="color:#C678DD;">				}</span><span style="color:#98C379;">&lt;/p&gt;</span><span style="color:#56B6C2;">\n</span><span style="color:#98C379;">`</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">			};</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">			// 为代码块添加 code-label 类</span></span>
<span class="line"><span style="color:#E5C07B;">			md</span><span style="color:#ABB2BF;">.</span><span style="color:#61AFEF;">use</span><span style="color:#ABB2BF;">(</span><span style="color:#C678DD;">function</span><span style="color:#ABB2BF;"> (</span><span style="color:#E06C75;font-style:italic;">md</span><span style="color:#ABB2BF;">) {</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">				// 保存默认的代码块渲染器</span></span>
<span class="line"><span style="color:#C678DD;">				const</span><span style="color:#E5C07B;"> defaultFence</span><span style="color:#56B6C2;"> =</span></span>
<span class="line"><span style="color:#E5C07B;">					md</span><span style="color:#ABB2BF;">.</span><span style="color:#E5C07B;">renderer</span><span style="color:#ABB2BF;">.</span><span style="color:#E5C07B;">rules</span><span style="color:#ABB2BF;">.</span><span style="color:#E06C75;">fence</span><span style="color:#56B6C2;"> ||</span></span>
<span class="line"><span style="color:#C678DD;">					function</span><span style="color:#ABB2BF;"> (</span><span style="color:#E06C75;font-style:italic;">tokens</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;font-style:italic;">idx</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;font-style:italic;">options</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;font-style:italic;">env</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;font-style:italic;">self</span><span style="color:#ABB2BF;">) {</span></span>
<span class="line"><span style="color:#C678DD;">						return</span><span style="color:#E5C07B;"> self</span><span style="color:#ABB2BF;">.</span><span style="color:#61AFEF;">renderToken</span><span style="color:#ABB2BF;">(</span><span style="color:#E06C75;">tokens</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">idx</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">options</span><span style="color:#ABB2BF;">);</span></span>
<span class="line"><span style="color:#ABB2BF;">					};</span></span>
<span class="line"></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">				// 修改代码块的渲染规则，保留默认样式</span></span>
<span class="line"><span style="color:#E5C07B;">				md</span><span style="color:#ABB2BF;">.</span><span style="color:#E5C07B;">renderer</span><span style="color:#ABB2BF;">.</span><span style="color:#E5C07B;">rules</span><span style="color:#ABB2BF;">.</span><span style="color:#61AFEF;">fence</span><span style="color:#56B6C2;"> =</span><span style="color:#ABB2BF;"> (</span><span style="color:#E06C75;font-style:italic;">tokens</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;font-style:italic;">idx</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;font-style:italic;">options</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;font-style:italic;">env</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;font-style:italic;">self</span><span style="color:#ABB2BF;">) </span><span style="color:#C678DD;">=&gt;</span><span style="color:#ABB2BF;"> {</span></span>
<span class="line"><span style="color:#C678DD;">					const</span><span style="color:#E5C07B;"> token</span><span style="color:#56B6C2;"> =</span><span style="color:#E06C75;"> tokens</span><span style="color:#ABB2BF;">[</span><span style="color:#E06C75;">idx</span><span style="color:#ABB2BF;">];</span></span>
<span class="line"><span style="color:#C678DD;">					const</span><span style="color:#E5C07B;"> info</span><span style="color:#56B6C2;"> =</span><span style="color:#E5C07B;"> token</span><span style="color:#ABB2BF;">.</span><span style="color:#E5C07B;">info</span><span style="color:#ABB2BF;">.</span><span style="color:#61AFEF;">trim</span><span style="color:#ABB2BF;">();</span></span>
<span class="line"></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">					// 初始化标志变量，检测是否在 code-group 内</span></span>
<span class="line"><span style="color:#C678DD;">					let</span><span style="color:#E06C75;"> inCodeGroup</span><span style="color:#56B6C2;"> =</span><span style="color:#D19A66;"> false</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">					// 遍历 tokens，判断是否位于 code-group 中</span></span>
<span class="line"><span style="color:#C678DD;">					for</span><span style="color:#ABB2BF;"> (</span><span style="color:#C678DD;">let</span><span style="color:#E06C75;"> i</span><span style="color:#56B6C2;"> =</span><span style="color:#D19A66;"> 0</span><span style="color:#ABB2BF;">; </span><span style="color:#E06C75;">i</span><span style="color:#56B6C2;"> &lt;=</span><span style="color:#E06C75;"> idx</span><span style="color:#ABB2BF;">; </span><span style="color:#E06C75;">i</span><span style="color:#56B6C2;">++</span><span style="color:#ABB2BF;">) {</span></span>
<span class="line"><span style="color:#C678DD;">						const</span><span style="color:#E5C07B;"> tokenType</span><span style="color:#56B6C2;"> =</span><span style="color:#E06C75;"> tokens</span><span style="color:#ABB2BF;">[</span><span style="color:#E06C75;">i</span><span style="color:#ABB2BF;">].</span><span style="color:#E06C75;">type</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">						// 如果遇到 container_code-group_open，标记为 true</span></span>
<span class="line"><span style="color:#C678DD;">						if</span><span style="color:#ABB2BF;"> (</span><span style="color:#E06C75;">tokenType</span><span style="color:#56B6C2;"> ===</span><span style="color:#98C379;"> &#39;container_code-group_open&#39;</span><span style="color:#ABB2BF;">) {</span></span>
<span class="line"><span style="color:#E06C75;">							inCodeGroup</span><span style="color:#56B6C2;"> =</span><span style="color:#D19A66;"> true</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">						}</span></span>
<span class="line"></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">						// 如果遇到 container_code-group_close，标记为 false</span></span>
<span class="line"><span style="color:#C678DD;">						if</span><span style="color:#ABB2BF;"> (</span><span style="color:#E06C75;">tokenType</span><span style="color:#56B6C2;"> ===</span><span style="color:#98C379;"> &#39;container_code-group_close&#39;</span><span style="color:#ABB2BF;">) {</span></span>
<span class="line"><span style="color:#E06C75;">							inCodeGroup</span><span style="color:#56B6C2;"> =</span><span style="color:#D19A66;"> false</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">						}</span></span>
<span class="line"><span style="color:#ABB2BF;">					}</span></span>
<span class="line"></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">					// 如果当前代码块在 code-group 中，保持默认渲染</span></span>
<span class="line"><span style="color:#C678DD;">					if</span><span style="color:#ABB2BF;"> (</span><span style="color:#E06C75;">inCodeGroup</span><span style="color:#ABB2BF;">) {</span></span>
<span class="line"><span style="color:#C678DD;">						return</span><span style="color:#61AFEF;"> defaultFence</span><span style="color:#ABB2BF;">(</span><span style="color:#E06C75;">tokens</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">idx</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">options</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">env</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">self</span><span style="color:#ABB2BF;">);</span></span>
<span class="line"><span style="color:#ABB2BF;">					}</span></span>
<span class="line"></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">					// 自定义逻辑：匹配带有中括号的代码块（如：css [custom.css]）</span></span>
<span class="line"><span style="color:#C678DD;">					const</span><span style="color:#E5C07B;"> match</span><span style="color:#56B6C2;"> =</span><span style="color:#E5C07B;"> info</span><span style="color:#ABB2BF;">.</span><span style="color:#61AFEF;">match</span><span style="color:#ABB2BF;">(</span><span style="color:#E06C75;">/</span><span style="color:#C678DD;">^</span><span style="color:#E06C75;">(\w</span><span style="color:#D19A66;">+</span><span style="color:#E06C75;">)\s</span><span style="color:#D19A66;">*</span><span style="color:#56B6C2;">\[</span><span style="color:#E06C75;">(.</span><span style="color:#D19A66;">*</span><span style="color:#E06C75;">)</span><span style="color:#56B6C2;">\]</span><span style="color:#C678DD;">$</span><span style="color:#E06C75;">/</span><span style="color:#ABB2BF;">);</span></span>
<span class="line"><span style="color:#C678DD;">					if</span><span style="color:#ABB2BF;"> (</span><span style="color:#E06C75;">match</span><span style="color:#ABB2BF;">) {</span></span>
<span class="line"><span style="color:#C678DD;">						const</span><span style="color:#E5C07B;"> language</span><span style="color:#56B6C2;"> =</span><span style="color:#E06C75;"> match</span><span style="color:#ABB2BF;">[</span><span style="color:#D19A66;">1</span><span style="color:#ABB2BF;">]; </span><span style="color:#7F848E;font-style:italic;">// 语言 (如 css, js 等)</span></span>
<span class="line"><span style="color:#C678DD;">						const</span><span style="color:#E5C07B;"> customLabel</span><span style="color:#56B6C2;"> =</span><span style="color:#E06C75;"> match</span><span style="color:#ABB2BF;">[</span><span style="color:#D19A66;">2</span><span style="color:#ABB2BF;">]; </span><span style="color:#7F848E;font-style:italic;">// 自定义内容 (如 custom.css)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">						// 在代码块之前插入 div，并保留代码块的默认渲染</span></span>
<span class="line"><span style="color:#C678DD;">						return</span><span style="color:#ABB2BF;"> (</span></span>
<span class="line"><span style="color:#98C379;">							`&lt;div class=&quot;code-label&quot;&gt;&lt;div class=&quot;code-label-text&quot;&gt;</span><span style="color:#C678DD;">${</span><span style="color:#E06C75;">customLabel</span><span style="color:#C678DD;">}</span><span style="color:#98C379;">&lt;/div&gt;&lt;/div&gt;`</span><span style="color:#56B6C2;"> +</span></span>
<span class="line"><span style="color:#61AFEF;">							defaultFence</span><span style="color:#ABB2BF;">(</span><span style="color:#E06C75;">tokens</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">idx</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">options</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">env</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">self</span><span style="color:#ABB2BF;">)</span></span>
<span class="line"><span style="color:#ABB2BF;">						);</span></span>
<span class="line"><span style="color:#ABB2BF;">					}</span></span>
<span class="line"></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">					// 如果不匹配，保持默认渲染</span></span>
<span class="line"><span style="color:#C678DD;">					return</span><span style="color:#61AFEF;"> defaultFence</span><span style="color:#ABB2BF;">(</span><span style="color:#E06C75;">tokens</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">idx</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">options</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">env</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">self</span><span style="color:#ABB2BF;">);</span></span>
<span class="line"><span style="color:#ABB2BF;">				};</span></span>
<span class="line"><span style="color:#ABB2BF;">			});</span></span>
<span class="line"><span style="color:#ABB2BF;">		},</span></span>
<span class="line"><span style="color:#ABB2BF;">	},</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">	// Head配置</span></span>
<span class="line"><span style="color:#E06C75;">	head</span><span style="color:#ABB2BF;">: [</span></span>
<span class="line"><span style="color:#ABB2BF;">		[</span><span style="color:#98C379;">&#39;link&#39;</span><span style="color:#ABB2BF;">, { </span><span style="color:#E06C75;">rel</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;icon&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">type</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;image/svg+xml&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">href</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;./logo/vitepress-logo-mini.svg&#39;</span><span style="color:#ABB2BF;"> }], </span><span style="color:#7F848E;font-style:italic;">// 网站图标</span></span>
<span class="line"><span style="color:#ABB2BF;">		[</span><span style="color:#98C379;">&#39;link&#39;</span><span style="color:#ABB2BF;">, { </span><span style="color:#E06C75;">rel</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;icon&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">type</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;image/png&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">href</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;./logo/vitepress-logo-mini.png&#39;</span><span style="color:#ABB2BF;"> }], </span><span style="color:#7F848E;font-style:italic;">// 网站图标</span></span>
<span class="line"><span style="color:#ABB2BF;">	],</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">	// 主题配置</span></span>
<span class="line"><span style="color:#E06C75;">	themeConfig</span><span style="color:#ABB2BF;">: {</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">		// https://vitepress.dev/reference/default-theme-config</span></span>
<span class="line"><span style="color:#E06C75;">		logo</span><span style="color:#ABB2BF;">: { </span><span style="color:#E06C75;">src</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;/logo/vitepress-logo-mini.svg&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">width</span><span style="color:#ABB2BF;">: </span><span style="color:#D19A66;">24</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">height</span><span style="color:#ABB2BF;">: </span><span style="color:#D19A66;">24</span><span style="color:#ABB2BF;"> }, </span><span style="color:#7F848E;font-style:italic;">// 左侧导航栏图标也可直接&#39;/logo/vitepress-logo-mini.svg&#39;</span></span>
<span class="line"><span style="color:#E06C75;">		siteTitle</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;VitePress基础框架&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 左侧导航栏标题</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">		// 导航菜单</span></span>
<span class="line"><span style="color:#E06C75;">		nav</span><span style="color:#ABB2BF;">: </span><span style="color:#61AFEF;">nav</span><span style="color:#ABB2BF;">(),</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">		// 侧边栏菜单</span></span>
<span class="line"><span style="color:#E06C75;">		sidebar</span><span style="color:#ABB2BF;">: {</span></span>
<span class="line"><span style="color:#98C379;">			&#39;/guide&#39;</span><span style="color:#ABB2BF;">: { </span><span style="color:#E06C75;">base</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;/guide&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">items</span><span style="color:#ABB2BF;">: </span><span style="color:#61AFEF;">sidebarDirections</span><span style="color:#ABB2BF;">() },</span></span>
<span class="line"><span style="color:#98C379;">			&#39;/examples&#39;</span><span style="color:#ABB2BF;">: { </span><span style="color:#E06C75;">base</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;/examples&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">items</span><span style="color:#ABB2BF;">: </span><span style="color:#61AFEF;">sidebarExamples</span><span style="color:#ABB2BF;">() },</span></span>
<span class="line"><span style="color:#ABB2BF;">		},</span></span>
<span class="line"><span style="color:#E06C75;">		outline</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;deep&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 在大纲中显示的标题级别</span></span>
<span class="line"><span style="color:#E06C75;">		outlineTitle</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;页面导航&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 大纲的标题</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">		// 提供编辑页面的链接</span></span>
<span class="line"><span style="color:#E06C75;">		editLink</span><span style="color:#ABB2BF;">: {</span></span>
<span class="line"><span style="color:#E06C75;">			pattern</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;https://github.com/dcdy/vitepress-template/edit/main/docs/:path&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">			text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;在 GitHub 上编辑此页面&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#ABB2BF;">		},</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">		// 上次更新时间显示文本</span></span>
<span class="line"><span style="color:#E06C75;">		lastUpdated</span><span style="color:#ABB2BF;">: {</span></span>
<span class="line"><span style="color:#E06C75;">			text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;最后更新于&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">			formatOptions</span><span style="color:#ABB2BF;">: {</span></span>
<span class="line"><span style="color:#E06C75;">				dateStyle</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;short&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 可选值short(默认)(2024/1/11)、medium(2024年1月1日)和full(2024年1月1日星期一)</span></span>
<span class="line"><span style="color:#E06C75;">				timeStyle</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;short&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 可选值short(默认)(18:00)、medium(18:00:00)和full(中国标准时间 18:00:00)</span></span>
<span class="line"><span style="color:#ABB2BF;">			},</span></span>
<span class="line"><span style="color:#ABB2BF;">		},</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">		// 底部翻页文本</span></span>
<span class="line"><span style="color:#E06C75;">		docFooter</span><span style="color:#ABB2BF;">: {</span></span>
<span class="line"><span style="color:#E06C75;">			prev</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;上一页&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">			next</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;下一页&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#ABB2BF;">		},</span></span>
<span class="line"><span style="color:#E06C75;">		footer</span><span style="color:#ABB2BF;">: {</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">			// 有 sidebar 时不显示</span></span>
<span class="line"><span style="color:#E06C75;">			message</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;基于MIT许可发布&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">			copyright</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">`版权所有 © </span><span style="color:#C678DD;">${</span></span>
<span class="line"><span style="color:#C678DD;">				new</span><span style="color:#61AFEF;"> Date</span><span style="color:#ABB2BF;">().</span><span style="color:#61AFEF;">getFullYear</span><span style="color:#ABB2BF;">() </span><span style="color:#56B6C2;">==</span><span style="color:#D19A66;"> 2024</span><span style="color:#C678DD;"> ?</span><span style="color:#D19A66;"> 2024</span><span style="color:#C678DD;"> :</span><span style="color:#D19A66;"> 2024</span><span style="color:#56B6C2;"> +</span><span style="color:#98C379;"> &#39;-&#39;</span><span style="color:#56B6C2;"> +</span><span style="color:#C678DD;"> new</span><span style="color:#61AFEF;"> Date</span><span style="color:#ABB2BF;">().</span><span style="color:#61AFEF;">getFullYear</span><span style="color:#ABB2BF;">()</span></span>
<span class="line"><span style="color:#C678DD;">			}</span><span style="color:#98C379;"> dcdyxmt@163.com`</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#ABB2BF;">		},</span></span>
<span class="line"><span style="color:#E06C75;">		socialLinks</span><span style="color:#ABB2BF;">: [</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">			// github友情连接</span></span>
<span class="line"><span style="color:#ABB2BF;">			{ </span><span style="color:#E06C75;">icon</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;github&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">link</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;https://github.com/dcdy/vitepress-template&#39;</span><span style="color:#ABB2BF;"> },</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">			// gitee友情连接(自定义图标)</span></span>
<span class="line"><span style="color:#ABB2BF;">			{</span></span>
<span class="line"><span style="color:#E06C75;">				icon</span><span style="color:#ABB2BF;">: {</span></span>
<span class="line"><span style="color:#E06C75;">					svg</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;&lt;svg t=&quot;1727428813465&quot; class=&quot;icon&quot; viewBox=&quot;0 0 1024 1024&quot; version=&quot;1.1&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; p-id=&quot;2268&quot; width=&quot;200&quot; height=&quot;200&quot;&gt;&lt;path d=&quot;M512 1024C229.222 1024 0 794.778 0 512S229.222 0 512 0s512 229.222 512 512-229.222 512-512 512z m259.149-568.883h-290.74a25.293 25.293 0 0 0-25.292 25.293l-0.026 63.206c0 13.952 11.315 25.293 25.267 25.293h177.024c13.978 0 25.293 11.315 25.293 25.267v12.646a75.853 75.853 0 0 1-75.853 75.853h-240.23a25.293 25.293 0 0 1-25.267-25.293V417.203a75.853 75.853 0 0 1 75.827-75.853h353.946a25.293 25.293 0 0 0 25.267-25.292l0.077-63.207a25.293 25.293 0 0 0-25.268-25.293H417.152a189.62 189.62 0 0 0-189.62 189.645V771.15c0 13.977 11.316 25.293 25.294 25.293h372.94a170.65 170.65 0 0 0 170.65-170.65V480.384a25.293 25.293 0 0 0-25.293-25.267z&quot; fill=&quot;#C71D23&quot; p-id=&quot;2269&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#ABB2BF;">				},</span></span>
<span class="line"><span style="color:#E06C75;">				link</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;https://gitee.com/xia_mei_ting/vitepress-template&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#ABB2BF;">			},</span></span>
<span class="line"><span style="color:#ABB2BF;">		],</span></span>
<span class="line"><span style="color:#E06C75;">		returnToTopLabel</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;回到顶部&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 用于自定义返回顶部按钮的标签，该标签仅在移动端视图中显示。</span></span>
<span class="line"><span style="color:#E06C75;">		sidebarMenuLabel</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;菜单&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 用于自定义侧边栏菜单标签，该标签仅在移动端视图中显示。</span></span>
<span class="line"><span style="color:#E06C75;">		darkModeSwitchLabel</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;主题&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 用于自定义悬停时显示的深色模式开关标题。</span></span>
<span class="line"><span style="color:#E06C75;">		lightModeSwitchTitle</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;切换到浅色模式&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 用于自定义悬停时显示的浅色模式开关标题。</span></span>
<span class="line"><span style="color:#E06C75;">		darkModeSwitchTitle</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;切换到深色模式&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 用于自定义深色模式开关标签，该标签仅在移动端视图中显示。</span></span>
<span class="line"><span style="color:#E06C75;">		externalLinkIcon</span><span style="color:#ABB2BF;">: </span><span style="color:#D19A66;">true</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 默认false，是否在 markdown 中的外部链接旁显示外部链接图标。</span></span>
<span class="line"><span style="color:#ABB2BF;">	},</span></span>
<span class="line"><span style="color:#E06C75;">	vite</span><span style="color:#ABB2BF;">: {</span></span>
<span class="line"><span style="color:#E06C75;">		css</span><span style="color:#ABB2BF;">: {</span></span>
<span class="line"><span style="color:#E06C75;">			preprocessorOptions</span><span style="color:#ABB2BF;">: {</span></span>
<span class="line"><span style="color:#E06C75;">				scss</span><span style="color:#ABB2BF;">: {</span></span>
<span class="line"><span style="color:#E06C75;">					silenceDeprecations</span><span style="color:#ABB2BF;">: [</span><span style="color:#98C379;">&#39;legacy-js-api&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#98C379;">&#39;color-functions&#39;</span><span style="color:#ABB2BF;">],</span></span>
<span class="line"><span style="color:#ABB2BF;">				},</span></span>
<span class="line"><span style="color:#ABB2BF;">			},</span></span>
<span class="line"><span style="color:#ABB2BF;">		},</span></span>
<span class="line"><span style="color:#ABB2BF;">	},</span></span>
<span class="line"><span style="color:#ABB2BF;">});</span></span>
<span class="line"></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">// 导航菜单</span></span>
<span class="line"><span style="color:#C678DD;">function</span><span style="color:#61AFEF;"> nav</span><span style="color:#ABB2BF;">(): </span><span style="color:#E5C07B;">DefaultTheme</span><span style="color:#ABB2BF;">.</span><span style="color:#E5C07B;">NavItem</span><span style="color:#ABB2BF;">[] {</span></span>
<span class="line"><span style="color:#C678DD;">	return</span><span style="color:#ABB2BF;"> [</span></span>
<span class="line"><span style="color:#ABB2BF;">		{</span></span>
<span class="line"><span style="color:#E06C75;">			text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;教程&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 导航栏标题</span></span>
<span class="line"><span style="color:#E06C75;">			link</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;/guide/install&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 导航栏路径</span></span>
<span class="line"><span style="color:#E06C75;">			activeMatch</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;/guide&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 动态匹配路径，高亮显示</span></span>
<span class="line"><span style="color:#ABB2BF;">		},</span></span>
<span class="line"><span style="color:#ABB2BF;">		{</span></span>
<span class="line"><span style="color:#E06C75;">			text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;示例&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">			link</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;/examples/markdown&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">			activeMatch</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;/examples&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#ABB2BF;">		},</span></span>
<span class="line"><span style="color:#ABB2BF;">		{</span></span>
<span class="line"><span style="color:#E06C75;">			text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;下拉导航&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">			items</span><span style="color:#ABB2BF;">: [</span></span>
<span class="line"><span style="color:#ABB2BF;">				{</span></span>
<span class="line"><span style="color:#E06C75;">					text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;下拉导航标题&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 该部分的标题，也可以省略标题</span></span>
<span class="line"><span style="color:#E06C75;">					items</span><span style="color:#ABB2BF;">: [</span></span>
<span class="line"><span style="color:#ABB2BF;">						{</span></span>
<span class="line"><span style="color:#E06C75;">							text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;子项A&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">							link</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;https://github.com/dcdy/vitepress-template/edit/main/docs/.vitepress/config.mts&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#ABB2BF;">						},</span></span>
<span class="line"><span style="color:#ABB2BF;">						{</span></span>
<span class="line"><span style="color:#E06C75;">							text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;子项B&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">							link</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;https://gitee.com/xia_mei_ting/vitepress-template/blob/main/docs/.vitepress/config.mts&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#ABB2BF;">						},</span></span>
<span class="line"><span style="color:#ABB2BF;">					],</span></span>
<span class="line"><span style="color:#ABB2BF;">				},</span></span>
<span class="line"><span style="color:#ABB2BF;">			],</span></span>
<span class="line"><span style="color:#ABB2BF;">		},</span></span>
<span class="line"><span style="color:#ABB2BF;">	];</span></span>
<span class="line"><span style="color:#ABB2BF;">}</span></span>
<span class="line"></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">// 教程侧边栏（多侧边栏,可折叠的侧边栏组）</span></span>
<span class="line"><span style="color:#C678DD;">function</span><span style="color:#61AFEF;"> sidebarDirections</span><span style="color:#ABB2BF;">(): </span><span style="color:#E5C07B;">DefaultTheme</span><span style="color:#ABB2BF;">.</span><span style="color:#E5C07B;">SidebarItem</span><span style="color:#ABB2BF;">[] {</span></span>
<span class="line"><span style="color:#C678DD;">	return</span><span style="color:#ABB2BF;"> [</span></span>
<span class="line"><span style="color:#ABB2BF;">		{</span></span>
<span class="line"><span style="color:#E06C75;">			text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;简介&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">			collapsed</span><span style="color:#ABB2BF;">: </span><span style="color:#D19A66;">false</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 默认不折叠。true：自动折叠；不添加collapsed属性不显示下拉图标</span></span>
<span class="line"><span style="color:#E06C75;">			items</span><span style="color:#ABB2BF;">: [</span></span>
<span class="line"><span style="color:#ABB2BF;">				{</span></span>
<span class="line"><span style="color:#E06C75;">					text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;安装&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">					link</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;/install&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#ABB2BF;">				},</span></span>
<span class="line"><span style="color:#ABB2BF;">				{</span></span>
<span class="line"><span style="color:#E06C75;">					text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;配置&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">					items</span><span style="color:#ABB2BF;">: [</span></span>
<span class="line"><span style="color:#ABB2BF;">						{</span></span>
<span class="line"><span style="color:#E06C75;">							text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;首页配置&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">							link</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;/config-home&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#ABB2BF;">						},</span></span>
<span class="line"><span style="color:#ABB2BF;">						{</span></span>
<span class="line"><span style="color:#E06C75;">							text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;文档配置&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">							link</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;/config-doc&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#ABB2BF;">						},</span></span>
<span class="line"><span style="color:#ABB2BF;">					],</span></span>
<span class="line"><span style="color:#ABB2BF;">				},</span></span>
<span class="line"><span style="color:#ABB2BF;">			],</span></span>
<span class="line"><span style="color:#ABB2BF;">		},</span></span>
<span class="line"><span style="color:#ABB2BF;">		{</span></span>
<span class="line"><span style="color:#E06C75;">			text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;部署&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">			collapsed</span><span style="color:#ABB2BF;">: </span><span style="color:#D19A66;">false</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">			items</span><span style="color:#ABB2BF;">: [</span></span>
<span class="line"><span style="color:#ABB2BF;">				{</span></span>
<span class="line"><span style="color:#E06C75;">					text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;Github Pages&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">					link</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;/github-pages&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#ABB2BF;">				},</span></span>
<span class="line"><span style="color:#ABB2BF;">			],</span></span>
<span class="line"><span style="color:#ABB2BF;">		},</span></span>
<span class="line"><span style="color:#ABB2BF;">	];</span></span>
<span class="line"><span style="color:#ABB2BF;">}</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">// 示例侧边栏（普通单侧边栏）</span></span>
<span class="line"><span style="color:#C678DD;">function</span><span style="color:#61AFEF;"> sidebarExamples</span><span style="color:#ABB2BF;">(): </span><span style="color:#E5C07B;">DefaultTheme</span><span style="color:#ABB2BF;">.</span><span style="color:#E5C07B;">SidebarItem</span><span style="color:#ABB2BF;">[] {</span></span>
<span class="line"><span style="color:#C678DD;">	return</span><span style="color:#ABB2BF;"> [</span></span>
<span class="line"><span style="color:#ABB2BF;">		{</span></span>
<span class="line"><span style="color:#E06C75;">			text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;示例&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">			items</span><span style="color:#ABB2BF;">: [</span></span>
<span class="line"><span style="color:#ABB2BF;">				{</span></span>
<span class="line"><span style="color:#E06C75;">					text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;Markdown&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">					items</span><span style="color:#ABB2BF;">: [</span></span>
<span class="line"><span style="color:#ABB2BF;">						{</span></span>
<span class="line"><span style="color:#E06C75;">							text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;基础示例&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">							link</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;/markdown&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#ABB2BF;">						},</span></span>
<span class="line"><span style="color:#ABB2BF;">						{</span></span>
<span class="line"><span style="color:#E06C75;">							text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;扩展示例&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">							link</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;/markdown-expand&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#ABB2BF;">						},</span></span>
<span class="line"><span style="color:#ABB2BF;">					],</span></span>
<span class="line"><span style="color:#ABB2BF;">				},</span></span>
<span class="line"><span style="color:#ABB2BF;">				{</span></span>
<span class="line"><span style="color:#E06C75;">					text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;API&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">					link</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;/api&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#ABB2BF;">				},</span></span>
<span class="line"><span style="color:#ABB2BF;">			],</span></span>
<span class="line"><span style="color:#ABB2BF;">		},</span></span>
<span class="line"><span style="color:#ABB2BF;">	];</span></span>
<span class="line"><span style="color:#ABB2BF;">}</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br><span class="line-number">49</span><br><span class="line-number">50</span><br><span class="line-number">51</span><br><span class="line-number">52</span><br><span class="line-number">53</span><br><span class="line-number">54</span><br><span class="line-number">55</span><br><span class="line-number">56</span><br><span class="line-number">57</span><br><span class="line-number">58</span><br><span class="line-number">59</span><br><span class="line-number">60</span><br><span class="line-number">61</span><br><span class="line-number">62</span><br><span class="line-number">63</span><br><span class="line-number">64</span><br><span class="line-number">65</span><br><span class="line-number">66</span><br><span class="line-number">67</span><br><span class="line-number">68</span><br><span class="line-number">69</span><br><span class="line-number">70</span><br><span class="line-number">71</span><br><span class="line-number">72</span><br><span class="line-number">73</span><br><span class="line-number">74</span><br><span class="line-number">75</span><br><span class="line-number">76</span><br><span class="line-number">77</span><br><span class="line-number">78</span><br><span class="line-number">79</span><br><span class="line-number">80</span><br><span class="line-number">81</span><br><span class="line-number">82</span><br><span class="line-number">83</span><br><span class="line-number">84</span><br><span class="line-number">85</span><br><span class="line-number">86</span><br><span class="line-number">87</span><br><span class="line-number">88</span><br><span class="line-number">89</span><br><span class="line-number">90</span><br><span class="line-number">91</span><br><span class="line-number">92</span><br><span class="line-number">93</span><br><span class="line-number">94</span><br><span class="line-number">95</span><br><span class="line-number">96</span><br><span class="line-number">97</span><br><span class="line-number">98</span><br><span class="line-number">99</span><br><span class="line-number">100</span><br><span class="line-number">101</span><br><span class="line-number">102</span><br><span class="line-number">103</span><br><span class="line-number">104</span><br><span class="line-number">105</span><br><span class="line-number">106</span><br><span class="line-number">107</span><br><span class="line-number">108</span><br><span class="line-number">109</span><br><span class="line-number">110</span><br><span class="line-number">111</span><br><span class="line-number">112</span><br><span class="line-number">113</span><br><span class="line-number">114</span><br><span class="line-number">115</span><br><span class="line-number">116</span><br><span class="line-number">117</span><br><span class="line-number">118</span><br><span class="line-number">119</span><br><span class="line-number">120</span><br><span class="line-number">121</span><br><span class="line-number">122</span><br><span class="line-number">123</span><br><span class="line-number">124</span><br><span class="line-number">125</span><br><span class="line-number">126</span><br><span class="line-number">127</span><br><span class="line-number">128</span><br><span class="line-number">129</span><br><span class="line-number">130</span><br><span class="line-number">131</span><br><span class="line-number">132</span><br><span class="line-number">133</span><br><span class="line-number">134</span><br><span class="line-number">135</span><br><span class="line-number">136</span><br><span class="line-number">137</span><br><span class="line-number">138</span><br><span class="line-number">139</span><br><span class="line-number">140</span><br><span class="line-number">141</span><br><span class="line-number">142</span><br><span class="line-number">143</span><br><span class="line-number">144</span><br><span class="line-number">145</span><br><span class="line-number">146</span><br><span class="line-number">147</span><br><span class="line-number">148</span><br><span class="line-number">149</span><br><span class="line-number">150</span><br><span class="line-number">151</span><br><span class="line-number">152</span><br><span class="line-number">153</span><br><span class="line-number">154</span><br><span class="line-number">155</span><br><span class="line-number">156</span><br><span class="line-number">157</span><br><span class="line-number">158</span><br><span class="line-number">159</span><br><span class="line-number">160</span><br><span class="line-number">161</span><br><span class="line-number">162</span><br><span class="line-number">163</span><br><span class="line-number">164</span><br><span class="line-number">165</span><br><span class="line-number">166</span><br><span class="line-number">167</span><br><span class="line-number">168</span><br><span class="line-number">169</span><br><span class="line-number">170</span><br><span class="line-number">171</span><br><span class="line-number">172</span><br><span class="line-number">173</span><br><span class="line-number">174</span><br><span class="line-number">175</span><br><span class="line-number">176</span><br><span class="line-number">177</span><br><span class="line-number">178</span><br><span class="line-number">179</span><br><span class="line-number">180</span><br><span class="line-number">181</span><br><span class="line-number">182</span><br><span class="line-number">183</span><br><span class="line-number">184</span><br><span class="line-number">185</span><br><span class="line-number">186</span><br><span class="line-number">187</span><br><span class="line-number">188</span><br><span class="line-number">189</span><br><span class="line-number">190</span><br><span class="line-number">191</span><br><span class="line-number">192</span><br><span class="line-number">193</span><br><span class="line-number">194</span><br><span class="line-number">195</span><br><span class="line-number">196</span><br><span class="line-number">197</span><br><span class="line-number">198</span><br><span class="line-number">199</span><br><span class="line-number">200</span><br><span class="line-number">201</span><br><span class="line-number">202</span><br><span class="line-number">203</span><br><span class="line-number">204</span><br><span class="line-number">205</span><br><span class="line-number">206</span><br><span class="line-number">207</span><br><span class="line-number">208</span><br><span class="line-number">209</span><br><span class="line-number">210</span><br><span class="line-number">211</span><br><span class="line-number">212</span><br><span class="line-number">213</span><br><span class="line-number">214</span><br><span class="line-number">215</span><br><span class="line-number">216</span><br><span class="line-number">217</span><br><span class="line-number">218</span><br><span class="line-number">219</span><br><span class="line-number">220</span><br><span class="line-number">221</span><br><span class="line-number">222</span><br><span class="line-number">223</span><br><span class="line-number">224</span><br><span class="line-number">225</span><br><span class="line-number">226</span><br><span class="line-number">227</span><br><span class="line-number">228</span><br><span class="line-number">229</span><br><span class="line-number">230</span><br><span class="line-number">231</span><br><span class="line-number">232</span><br><span class="line-number">233</span><br><span class="line-number">234</span><br><span class="line-number">235</span><br><span class="line-number">236</span><br><span class="line-number">237</span><br><span class="line-number">238</span><br><span class="line-number">239</span><br><span class="line-number">240</span><br><span class="line-number">241</span><br><span class="line-number">242</span><br><span class="line-number">243</span><br><span class="line-number">244</span><br><span class="line-number">245</span><br><span class="line-number">246</span><br><span class="line-number">247</span><br><span class="line-number">248</span><br><span class="line-number">249</span><br><span class="line-number">250</span><br><span class="line-number">251</span><br><span class="line-number">252</span><br><span class="line-number">253</span><br><span class="line-number">254</span><br><span class="line-number">255</span><br><span class="line-number">256</span><br><span class="line-number">257</span><br><span class="line-number">258</span><br><span class="line-number">259</span><br><span class="line-number">260</span><br><span class="line-number">261</span><br><span class="line-number">262</span><br><span class="line-number">263</span><br><span class="line-number">264</span><br><span class="line-number">265</span><br><span class="line-number">266</span><br><span class="line-number">267</span><br><span class="line-number">268</span><br><span class="line-number">269</span><br><span class="line-number">270</span><br><span class="line-number">271</span><br><span class="line-number">272</span><br><span class="line-number">273</span><br><span class="line-number">274</span><br><span class="line-number">275</span><br><span class="line-number">276</span><br><span class="line-number">277</span><br><span class="line-number">278</span><br><span class="line-number">279</span><br><span class="line-number">280</span><br><span class="line-number">281</span><br><span class="line-number">282</span><br><span class="line-number">283</span><br><span class="line-number">284</span><br><span class="line-number">285</span><br><span class="line-number">286</span><br><span class="line-number">287</span><br><span class="line-number">288</span><br><span class="line-number">289</span><br><span class="line-number">290</span><br><span class="line-number">291</span><br><span class="line-number">292</span><br><span class="line-number">293</span><br><span class="line-number">294</span><br><span class="line-number">295</span><br><span class="line-number">296</span><br><span class="line-number">297</span><br><span class="line-number">298</span><br><span class="line-number">299</span><br><span class="line-number">300</span><br><span class="line-number">301</span><br><span class="line-number">302</span><br><span class="line-number">303</span><br><span class="line-number">304</span><br><span class="line-number">305</span><br><span class="line-number">306</span><br></div></div></details><p><code>docs/index.md</code>是主页结构配置文件</p><details class="details custom-block"><summary>点击查看 index.md 完整配置</summary><div class="code-label"><div class="code-label-text">index.md</div></div><div class="language-md line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">md</span><pre class="shiki one-dark-pro vp-code" tabindex="0"><code><span class="line"><span style="color:#ABB2BF;">---</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;"># https://vitepress.dev/reference/default-theme-home-page</span></span>
<span class="line"><span style="color:#E06C75;">layout</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">home</span></span>
<span class="line"></span>
<span class="line"><span style="color:#E06C75;">hero</span><span style="color:#ABB2BF;">:</span></span>
<span class="line"><span style="color:#E06C75;">    name</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">VitePress基础框架</span><span style="color:#7F848E;font-style:italic;"> # 标题</span></span>
<span class="line"><span style="color:#E06C75;">    text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">VitePress基础框架的站点描述</span><span style="color:#7F848E;font-style:italic;"> # 站点描述副标题</span></span>
<span class="line"><span style="color:#E06C75;">    tagline</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">VitePress基础框架的宣传词</span><span style="color:#7F848E;font-style:italic;"> # 宣传词</span></span>
<span class="line"><span style="color:#E06C75;">    image</span><span style="color:#ABB2BF;">: </span><span style="color:#7F848E;font-style:italic;"># LOGO</span></span>
<span class="line"><span style="color:#E06C75;">        src</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">/logo/vitepress-logo-large.webp</span></span>
<span class="line"><span style="color:#E06C75;">        alt</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">VitePress基础框架LOGO</span></span>
<span class="line"><span style="color:#E06C75;">    actions</span><span style="color:#ABB2BF;">: </span><span style="color:#7F848E;font-style:italic;"># 按钮</span></span>
<span class="line"><span style="color:#ABB2BF;">        - </span><span style="color:#E06C75;">theme</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">brand</span><span style="color:#7F848E;font-style:italic;"> # 选中状态</span></span>
<span class="line"><span style="color:#E06C75;">          text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">快速开始</span></span>
<span class="line"><span style="color:#E06C75;">          link</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">/guide/install</span></span>
<span class="line"><span style="color:#ABB2BF;">        - </span><span style="color:#E06C75;">theme</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">alt</span><span style="color:#7F848E;font-style:italic;"> # 未选中状态</span></span>
<span class="line"><span style="color:#E06C75;">          text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">示例</span></span>
<span class="line"><span style="color:#E06C75;">          link</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">/examples/markdown</span></span>
<span class="line"><span style="color:#ABB2BF;">        - </span><span style="color:#E06C75;">theme</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">custom-action</span></span>
<span class="line"><span style="color:#E06C75;">          text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">自定义action</span></span>
<span class="line"><span style="color:#E06C75;">          link</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">/guide/config-home#自定义-action</span></span>
<span class="line"></span>
<span class="line"><span style="color:#E06C75;">features</span><span style="color:#ABB2BF;">: </span><span style="color:#7F848E;font-style:italic;"># 特性</span></span>
<span class="line"><span style="color:#ABB2BF;">    - </span><span style="color:#E06C75;">title</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">内容丰富</span></span>
<span class="line"><span style="color:#E06C75;">      icon</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">📚</span></span>
<span class="line"><span style="color:#E06C75;">      details</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">模板精心设计了内容结构，支持从小型项目到大型文档的全面组织，确保每个细节都能够清晰呈现，帮助用户快速查找所需信息。</span></span>
<span class="line"><span style="color:#ABB2BF;">    - </span><span style="color:#E06C75;">title</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">注释详尽</span></span>
<span class="line"><span style="color:#E06C75;">      icon</span><span style="color:#ABB2BF;">:</span></span>
<span class="line"><span style="color:#E06C75;">          src</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">/features_icon/features-icon-1.svg</span></span>
<span class="line"><span style="color:#E06C75;">          width</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">30px</span></span>
<span class="line"><span style="color:#E06C75;">          height</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">30px</span></span>
<span class="line"><span style="color:#E06C75;">      details</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">每一处配置、每一个功能都有详细的注释说明，确保即使是新手也能轻松理解和使用，让文档维护和二次开发变得更加简单。</span></span>
<span class="line"><span style="color:#ABB2BF;">    - </span><span style="color:#E06C75;">title</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">高效构建</span></span>
<span class="line"><span style="color:#E06C75;">      icon</span><span style="color:#ABB2BF;">:</span></span>
<span class="line"><span style="color:#E06C75;">          dark</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">/features_icon/features-icon-2.svg</span></span>
<span class="line"><span style="color:#E06C75;">          light</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">/features_icon/features-icon-3.svg</span></span>
<span class="line"><span style="color:#E06C75;">          width</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">30px</span></span>
<span class="line"><span style="color:#E06C75;">          height</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">30px</span></span>
<span class="line"><span style="color:#E06C75;">      details</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">基于 Vite 的超快构建和热更新特性，让文档编写和预览流畅无阻。无论文档规模多大，都能保持快速响应和高效加载。</span></span>
<span class="line"><span style="color:#ABB2BF;">---</span></span>
<span class="line"></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">&lt;!-- @format --&gt;</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br></div></div></details></div></div></main><footer class="VPDocFooter" data-v-184b3be7 data-v-418b990b><!--[--><!--]--><div class="edit-info" data-v-418b990b><div class="edit-link" data-v-418b990b><a class="VPLink link vp-external-link-icon no-icon edit-link-button" href="https://github.com/dcdy/vitepress-template/edit/main/docs/guide/install.md" target="_blank" rel="noreferrer" data-v-418b990b><!--[--><span class="vpi-square-pen edit-link-icon" data-v-418b990b></span> 在 GitHub 上编辑此页面<!--]--></a></div><div class="last-updated" data-v-418b990b><p class="VPLastUpdated" data-v-418b990b data-v-6a80e2fe>最后更新于: <time datetime="2024-12-03T05:11:06.000Z" data-v-6a80e2fe></time></p></div></div><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-418b990b><span class="visually-hidden" id="doc-footer-aria-label" data-v-418b990b>Pager</span><div class="pager" data-v-418b990b><!----></div><div class="pager" data-v-418b990b><a class="VPLink link pager-link next" href="/vitepress-template-public/guide/config-home" data-v-418b990b><!--[--><span class="desc" data-v-418b990b>下一页</span><span class="title" data-v-418b990b>首页配置</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><footer class="VPFooter has-sidebar" data-v-b928bd87 data-v-fdadc4f9><div class="container" data-v-fdadc4f9><p class="message" data-v-fdadc4f9>基于MIT许可发布</p><p class="copyright" data-v-fdadc4f9>版权所有 © 2024 dcdyxmt@163.com</p></div></footer><!--[--><!--]--></div></div>
    
    
  </body>
</html>